<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">提单明细表</ui:define>
    <ui:define name="content">
        <h:form>
            <p:defaultCommand target="search"/>
            <div class="topbar clearfix" style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="left">
                        <p:commandButton id="toggler" type="button" value="展示选择"
                                         style="width: auto;"
                                         icon="ui-icon-calculator"/>

                        <p:columnToggler datasource="LoanLargeAmountPlusRecordDataTable" trigger="toggler"/>
                    </f:facet>
                    <f:facet name="right">
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                                         update="@form"/>
                        <p:commandButton value="重置" icon="fa fa-refresh"
                                         rendered="#{loanLargeAmountPlusRecordListBean.isNormal()}"
                                         actionListener="#{loanLargeAmountPlusRecordListBean.onReset}"
                                         process="@this" update="@form"/>
                        <p:commandButton value="导出" icon="fa fa-download"
                                         ajax="false">
                            <p:dataExporter type="xls" target="LoanLargeAmountPlusRecordDataTable" fileName="export"/>
                        </p:commandButton>
                    </f:facet>
                </p:toolbar>
            </div>
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="ui-g-12 card">
                            <h1>查询条件</h1>
                            <div class="ui-g-1">
                                <p:outputLabel  value="开始日期"/>
                            </div>
                            <div class="ui-g-3">
                                <p:calendar
                                        id="startDate" styleClass="autoWidthCalendar"
                                        value="#{loanLargeAmountPlusRecordListBean.$.startDate}"
                                        locale="#{constants:get('LOCALE')}"
                                        timeZone="#{constants:get('TIME_ZONE')}"
                                        pattern="#{constants:get('DATE_FORMAT')}"/>
                            </div>
                            <div class="ui-g-1"><p:outputLabel  value="结束日期"/></div>
                            <div class="ui-g-3">
                                <p:calendar
                                        id="endDate" styleClass="autoWidthCalendar"
                                        value="#{loanLargeAmountPlusRecordListBean.$.endDate}"
                                        locale="#{constants:get('LOCALE')}"
                                        timeZone="#{constants:get('TIME_ZONE')}"
                                        pattern="#{constants:get('DATE_FORMAT')}"/>
                            </div>
                            <div class="ui-g-1">
                                <p:outputLabel value="姓名"/>
                            </div>
                            <div class="ui-g-3">
                                <p:inputText id="mobmun" value="#{loanLargeAmountPlusRecordListBean.$.petname}"/>
                            </div>
                            <div class="ui-g-1">
                                <p:outputLabel value="渠道"/>
                            </div>
                            <div class="ui-g-3">
                                <p:selectCheckboxMenu id="channel" value="#{loanLargeAmountPlusRecordListBean.$.c_from}" label="channel"
                                                      updateLabel="true" filter="true" filterMatchMode="contains" panelStyle="width:250px" multiple="true">
                                    <f:selectItems value="#{loanLargeAmountPlusRecordListBean.getCfrom()}"/>
                                </p:selectCheckboxMenu>
                            </div>
                            <div class="ui-g-1">
                                <p:outputLabel value="订单状态"/>
                            </div>
                            <div class="ui-g-3">
                                <p:selectOneMenu id="status"
                                                 value="#{loanLargeAmountPlusRecordListBean.$.status}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItem itemLabel="- 补充更新 -" itemValue="4" />
                                    <f:selectItem itemLabel="- 已提交 -" itemValue="1" />
                                    <f:selectItem itemLabel="- 未提交 -" itemValue="0" />
                                    <f:selectItem itemLabel="- 申请失败 -" itemValue="2" />
                                    <f:selectItem itemLabel="- 有资格待提交 -" itemValue="3" />
                                    <f:selectItem itemLabel="- 已提交(重复) -" itemValue="5" />
                                    <f:selectItem itemLabel="- 失效 -" itemValue="6" />
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-1">
                                <p:outputLabel value="甲方"/>
                            </div>
                            <div class="ui-g-3">
                                <p:selectOneMenu id="ownner"
                                                 value="#{loanLargeAmountPlusRecordListBean.$.type}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems value="#{loanLargeAmountPlusRecordListBean.getTypeOwnner()}"
                                                   var="ownner"
                                                   itemLabel="#{ownner.ownername}"
                                                   itemValue="#{ownner.type}"/>/>
                                </p:selectOneMenu>
                            </div>
                            <div class="ui-g-1">
                                <p:outputLabel value="来源"/>
                            </div>
                            <div class="ui-g-3">
                                <p:selectCheckboxMenu id="wherecfrom"
                                                 value="#{loanLargeAmountPlusRecordListBean.$.whereCFrom}"
                                    filter="true" filterMatchMode="contains" panelStyle="width:250px" multiple="true">
                                    <f:selectItem itemLabel="- 外推 -" itemValue="外推" />
                                    <f:selectItem itemLabel="- 站内 -" itemValue="站内" />
                                    <f:selectItems value="#{loanLargeAmountPlusRecordListBean.getZhanNeiCFrom()}"
                                            var="wherecfrom"
                                                   itemLabel="#{wherecfrom}"
                                                   itemValue="#{wherecfrom}"
                                    />
                                </p:selectCheckboxMenu>
                            </div>

                        </div>
                        <div class="card">
                            <p:dataTable id="LoanLargeAmountPlusRecordDataTable"
                                         style="width: 100%;text-align:center"
                                         var="prepaid"
                                         value="#{loanLargeAmountPlusRecordListBean.lazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         reflow="true"
                                         selection="#{loanLargeAmountPlusRecordListBean.selectedRecords}"
                                         resizableColumns="true">
                                <p:column headerText="时间">
                                    <h:outputText value="#{prepaid.time}"/>
                                </p:column>
                                <p:column headerText="产品">
                                    <h:outputText value="#{prepaid.productName}"/>
                                </p:column>
                                <p:column headerText="来源">
                                    <h:outputText value="#{prepaid.whereForm}"/>
                                </p:column>
                                <p:column headerText="渠道">
                                    <h:outputText value="#{prepaid.c_form}"/>
                                </p:column>
                                <p:column headerText="姓名">
                                    <h:outputText value="#{prepaid.petname}"/>
                                </p:column>
                                <p:column headerText="手机">
                                    <h:outputText value="#{prepaid.mobnum}"/>
                                </p:column>
                                <p:column headerText="申请金额">
                                    <h:outputText value="#{prepaid.approveamount}"/>
                                </p:column>
                                <p:column headerText="所在城市">
                                    <h:outputText value="#{prepaid.city}"/>
                                </p:column>
                                <p:column headerText="月收入">
                                    <h:outputText value="#{prepaid.income}"/>
                                </p:column>
                                <p:column headerText="是否有房">
                                    <h:outputText value="#{prepaid.has_easten}"/>
                                </p:column>
                                <p:column headerText="是否有车">
                                    <h:outputText value="#{prepaid.has_car}"/>
                                </p:column>
                                <p:column headerText="是否有寿险">
                                    <h:outputText value="#{prepaid.life_insurance}"/>
                                </p:column>
                                <p:column headerText="是否有社保">
                                    <h:outputText value="#{prepaid.social_insurance}"/>
                                </p:column>
                                <p:column headerText="是否有信用卡">
                                    <h:outputText value="#{prepaid.credit}"/>
                                </p:column>
                                <p:column headerText="是否有微粒贷">
                                    <h:outputText value="#{prepaid.has_weili}"/>
                                </p:column>
                                <p:column headerText="职业身份">
                                    <h:outputText value="#{loanLargeAmountPlusRecordListBean.translate(prepaid.profession_type)}"/>
                                </p:column>
                                <p:column headerText="中高级用户等级">
                                    <h:outputText value="#{prepaid.user_level}"/>
                                </p:column>
                                <p:column headerText="申请状态">
                                    <h:outputText value="#{prepaid.approveStatus}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
